﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using PropertyChanged;
using RandomMobileNumber.Models;

namespace RandomMobileNumber.ViewModels
{
    [ImplementPropertyChanged]
    public class NumberPropertyViewModel:ViewModelBase
    {
        public Number Number { get; set; }

        public NumberPropertyViewModel()
        {

        }

        private RelayCommand cancelCommand;

        /// <summary>
        /// 已选号码双击
        /// </summary>
        public RelayCommand CancelCommand
        {
            get
            {
                return cancelCommand ?? (cancelCommand = new RelayCommand(() =>
                {
                MessengerInstance.Send(new NotificationMessage("cancel"));
                }));
            }
        }

        private RelayCommand okCommand;

        /// <summary>
        /// 已选号码双击
        /// </summary>
        public RelayCommand OkCommand
        {
            get
            {
                return okCommand ?? (okCommand = new RelayCommand(() =>
                {
                    MessengerInstance.Send(new NotificationMessage("ok"));
                }));
            }
        }
    }
}
